define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'store.comment/index',
        add_url: 'store.comment/add',
        edit_url: 'store.comment/edit',
        delete_url: 'store.comment/delete',
        export_url: 'store.comment/export',
        modify_url: 'store.comment/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: '主键id',search:false},
                    {field: 'goods_id', title: '商品信息'},
                    {field: 'image', title: '评论图片', templet: ea.table.image,search:false},
                    {field: 'score', title: '评分',search:false},
                    {field: 'username', title: '用户名',search:true},
                    {field: 'reply', title: '评论回复',search:false},
                    {field: 'is_reply', title: '评论回复', search: 'select', selectList: {0: '未回复', 1: '已回复'}},
                    {field: 'reply_time', title: '评论回复时间',search:false},
                    {width: 150, title: '操作', templet: ea.table.tool},
                ]],
            });
            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});